class Language < ActiveRecord::Base
  acts_as_dropdown  :text => "name", :order => "name"
  has_many :books
  validates_presence_of :name
  
  def can_destroy?
    @books = Book.find(:all, :conditions => ["language_id = ?", self.id])
    return @books.empty?
  end
end
